package com.sskj.b70.p.fragment;

import com.lzy.okgo.model.Response;
import com.sskj.b70.m.StockCoinBean;
import com.sskj.b70.m.bean.HttpData;
import com.sskj.b70.m.http.JsonCallBack;
import com.sskj.b70.p.base.BasePresenter;
import com.sskj.b70.v.fragment.SummaryFragment;

import java.util.List;

/**
 * Created by Administrator on 2018/4/10.
 */

public class SummaryPresenter extends BasePresenter<SummaryFragment> {

    public void getData(String code) {
        httpService.getProduct(code)
                .execute(new JsonCallBack<HttpData<List<StockCoinBean>>>() {
                    @Override
                    protected void _onSuccess(Response<HttpData<List<StockCoinBean>>> response) {
                        mView.setData(response.body().getData().get(0));
                    }
                });
    }

}
